﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>修改密码</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="__STATIC__heiseshop_admin/style/adminStyle.css" rel="stylesheet" type="text/css" />
<script src="__STATIC__heiseshop_admin/js/jquery.js"></script>
</head>
<body>
 <div class="wrap">
  <div class="page-title">
    <span class="modular fl"><i class="user"></i><em>修改密码</em></span>
  </div>
  <form action="edit_pwd" method="post">
  <table class="noborder">
   <tr>
    <td width="15%" style="text-align:right;">账号：</td>
    <td><input id="user" name="user" type="text" class="textBox length-middle" required="请填写账号"/></td>
   </tr>
   <tr>
    <td style="text-align:right;">邮箱：</td>
    <td><input id="email" type="text" class="textBox length-middle" required="required"/></td>
   </tr>
   <tr>
    <td style="text-align:right;">旧密码：</td>
    <td><input id="oldpwd" type="password" class="textBox length-middle" required="required" style="float: left;"/><span id="xinxi" style="float: left;margin-left:10px;color:red;display:none">信息输入错误!*</span></td>
   </tr>
   <tr>
    <td style="text-align:right;">新密码：</td>
    <td><input id="newpwd" type="password" required="required" class="textBox length-middle"/></td>
   </tr>
   <tr>
    <td style="text-align:right;">再次确认密码：</td>
    <td><input id="repwd" name="pwd" type="password" class="textBox length-middle" required="required" style="float: left;"/><span id="error" style="float: left;margin-left:10px;color:red;display:none">确认密码错误!*</span></td>
   </tr>
   <tr>
    <td style="text-align:right;"></td>
    <td><input type="submit" class="tdBtn" value="修改"/></td>
   </tr>
  </table>
  </form>
 </div>
</body>
</html>
<script>
  $('#oldpwd').blur(function(){
    var user=$('#user').val();
    var email=$('#email').val();
    var oldpwd=$('#oldpwd').val();
    $.ajax({
        url : "code_pwd",
        data:'user='+user+'&email='+email+'&oldpwd='+oldpwd,            
        success:function(res){
            if(!res){
              $('#xinxi').css('display','block');
            }else{
              $('#xinxi').css('display','none');
            }
        }
    })
  })
  $('#repwd').blur(function(){
    if($('#newpwd').val()!=$('#repwd').val()){
      $('#error').css('display','block');
    }else{
      $('#error').css('display','none');
    }
  })
</script>